This section describes the functions you can use to track mouse activity in the zoom box and to zoom windows.
Tracks the cursor when the user presses the mouse button while the cursor is in the zoom box.
pascal Boolean TrackBox (WindowPtr theWindow,
Point thePt,
short partCode);
The TrackBox function tracks the cursor when the user presses the mouse button while the cursor is in the zoom box, retaining control until the mouse button is released. While the button is down, TrackBox highlights the zoom box while the cursor is in the zoom region.
When the mouse button is released, TrackBox removes the highlighting from the zoom box and returns true if the cursor is within the zoom region and false if it is not.
Your application calls the TrackBox function when it receives a result code of either inZoomIn or inZoomOut from the FindWindow function (FindWindow) . If TrackBox returns true , your application calculates the standard state, if necessary, and calls the ZoomWindow function (ZoomWindow) to zoom the window. If TrackBox returns false , your application does nothing.
You can set the global variable DragHook to point to an optional function, defined by your application, which will be called by TrackBox as long as the mouse button is held down. (If there's an actionProc function, the actionProc function is called first.) Note that the use of the Window Manager's global variables is not guaranteed to be compatible with system software versions later than System 6.
Zooms the window when the user has pressed and released the mouse button with the cursor in the zoom box.
pascal void ZoomWindow (WindowPtr theWindow,
short partCode,
Boolean front);
The ZoomWindow function zooms a window in or out, depending on the value of the partCode parameter. Your application calls ZoomWindow , passing it the part code returned by FindWindow (FindWindow) , when it receives a result of true from TrackBox . The ZoomWindow function then changes the window's port rectangle to either the user state (if the part code is inZoomIn ) or the standard state (if the part code is inZoomOut ), as stored in the window state data record.
If the part code is inZoomOut , your application ordinarily calculates and sets the standard state before calling ZoomWindow .
For best results, call the QuickDraw function EraseRect , passing the window's graphics port as the port rectangle, before calling ZoomWindow .